***MASTER DO FILE***

clear all
set more off
cap log close
cap macro drop _all

global folder "..."

global original "$folder/original/" // original files folder for mac users. For Windows use backslash

cd "$folder"

set maxvar 120000

qui {
do 1_sample_selection // mainly selects variables from RAND-HRS version p. It includes the sub-do files listed below:
*1a_cognitive // adds variables on cognitive abilities (HRS Imputation of Cognitive Functioning Measures)
*1b_numeracy //adds HRS-Core variables on numeracy tests
*1c_wellbeing // adds HRS-Core variables on life satisfaction, optimism, financial strain, and well-being
*1d_thomreut_returns // uploads variables on stock market returns from Datastrem and Statista
*1e_tracker //uploads the tracker file needed to add financial data from other HRS-Core modules 
*1f_transfers // adds HRS-Core variables on transfers to children
*1g_camsrand // adds RAND-CAMS consumption variables
*1h_capgain // adds HRS-Core variables needed to measure financial activity
*1i_assetverif // adds HRS-Core variables on assets verification
do 2_working_samples // generates the two working samples (static for the main tables and dynamic for the DID)
}
do 3_main_tables // generates all tables in the main text
do 4_tables_appendix // generates all tables in the Appendix
do 5_figures // generates all figures (main text+appendix). It includes the following sub-do file:
*5_1_stock_market_returns // generates Appendix Figure A.1

